package com.bwie.service.impl;

import com.bwie.common.domain.Menu;
import com.bwie.common.domain.Role;
import com.bwie.common.domain.User;
import com.bwie.common.result.Result;
import com.bwie.mapper.UserMapper;
import com.bwie.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @className: UserServiceImpl
 * @Description: TODO
 * @version: v1.８.0
 * @author: 张雨乐
 * @date: 2025/9/1 9:31
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;
    @Override
    public Result<User> phone(String phone) {
        User user=userMapper.phone(phone);
        return Result.success(user);
    }

    @Override
    public Result<List<Role>> getRole(Integer id) {
        List<Role> roleList=userMapper.getRole(id);
        return Result.success(roleList);
    }

    @Override
    public Result<List<Menu>> menu(String roleId) {
        List<Menu> roleList=userMapper.menu(roleId);
        return Result.success(roleList);
    }
}
